<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});

Route::get('login', 'Login/index');


//接到hb的login登录数据，进行验证
Route::post('check', 'Login/check')->allowCrossDomain();
//获取验证码
Route::get('getCaptcha', 'Login/getCaptcha')->allowCrossDomain();
//退出登录
Route::get('logout', 'Login/logout')->allowCrossDomain();
//自己测试token
Route::get('test', 'Login/test');
//跳转展示列表
Route::get('list', 'Login/show')->middleware(\app\adminapi\middleware\Login::class);
//管理员列表
Route::get('adminList', 'User/index')->allowCrossDomain();
/**
 * 文件上传
 */
//商品中的多文件上传
Route::post('pics', 'Goods/add_pic')->allowCrossDomain();
//商品中的单文件上传
Route::post('pic', 'Goods/addPic')->allowCrossDomain();
/**
 * 商品品牌
 */
//商品品牌列表
Route::get('brandList', 'Goods/brand_show')->allowCrossDomain();
//商品品牌添加
Route::post('brandAdd', 'Goods/brand_add')->allowCrossDomain();
//商品品牌删除
Route::get('brandDel', 'Goods/brand_del')->allowCrossDomain();
//商品的修改
Route::post('brandEdit', 'Goods/brand_edit')->allowCrossDomain();
/**
 * 角色
 */
Route::resource('role', 'Role')->allowCrossDomain();
/**
 * 商品规格
 */
//测试四表的关联关系
Route::get('testType', 'type/test')->allowCrossDomain();
Route::resource('type', 'type')->allowCrossDomain();

/**
 * 商品列表
 */
//商品列表
Route::get('goods', 'Goods/index')->allowCrossDomain();
//商品添加
Route::post('goodsAdd', 'Goods/save')->allowCrossDomain();
//商品删除
Route::get('goodsDel/:id', 'Goods/delete')->allowCrossDomain();
//商品修改
Route::get('goodsEdit/:id', 'Goods/edit')->allowCrossDomain();
Route::post('goodsUpdate/:id', 'Goods/update')->allowCrossDomain();
